Skip to main content

All Questions

0votes
1answer
145views

Should requirement/issue number/code be included in the comments of the source code? [duplicate]

I am working on a number of maintenance projects and I always include requirement/issue number/code in the the comments whenever I am adding or changing code. In such way I provide traceability from ...
TomR's user avatar
  • 1,009
-1votes
4answers
192views

Best possible way to comment? [closed]

My question is simple, how should I comment during development so that it can be beneficial in the following cases: Understandable for my seniors while code reviewing. Should be able to search my work ...
FaizanHussainRabbani's user avatar
8votes
3answers
1kviews

Is reading javadoc preferable to reading source code to familiarise yourself with a library?

I just came across the following in a lab manual at university: You do need to study the interfaces of the classes by generating the javadoc for them so you know what operations are provided (feel ...
Todd Davies's user avatar
39votes
16answers
8kviews

Good idea to put bug numbers in a comment in the beginning of the source file? [closed]

Is it a good practice to put bug numbers in the file itself inside a header comment? The comments would look something like this: MODIFIED (MM/DD/YY) abc 01/21/14 - Bug 17452317 - npe in drill ...
2votes
6answers
1kviews

Shouldn't we count characters of code and comments instead of lines of code and comments? [closed]

Counting lines of code and comments is sometimes bogus, since most of what we write may be written in one or more lines, depending column count limitations, screen size, style and so forth. Since the ...
Gabriel's user avatar
22votes
7answers
20kviews

Is it necessary to write a javadoc comment for EVERY parameter in a method's signature?

One of the devs on my team believes that it is necessary to write a javadoc comment for EVERY parameter in a method's signature. I do not think this is necessary, and in fact I think it can even be ...
sangfroid's user avatar
12votes
11answers
6kviews

Version control comments - past or present tense [closed]

For version control comments what do other users do/recommend - past or present tense? I.e. Changed x to be y. or Changing x to be y.
Robert W's user avatar
22votes
10answers
6kviews

"// ..." comments at end of code block after } - good or bad? [closed]

I've often seen such comments be used: function foo() { ... } // foo while (...) { ... } // while if (...) { ... } // if and sometimes even as far as if (condition) { ... } // if (...
gablin's user avatar
  • 17.5k
6votes
4answers
537views

Correct alignment when outcommenting code

Suppose I have some code void some_block(void) { some_statement_1(); some_statement_2(); some_statement_3(); } Now I wish to out-comment statement #2, but here I never can find a way ...
Bjarke Freund-Hansen's user avatar
34votes
9answers
19kviews

What are your thoughts on Periods/Full Stops in code comments? [closed]

I saw this asked in the SO Tavern, so I'm posting the question here. I thought it an interesting question. (Of course it doesn't belong on SO, but I think it's OK here.) Do you add periods (or, as ...
Moshe's user avatar
  • 5,042

close